package com.my.chapter19;

import net.mindView.enums.Signal;
import static net.mindView.enums.Signal.*;

public class practice1 {
    Signal color = RED;
    public void change(){
        switch (color){
            case RED:   color = GREEN;break;
            case GREEN: color = YELLOW;break;
            case YELLOW:color = RED;break;
        }
    }

    @Override
    public String toString() {
        return "The traffic light is " + color;
    }

    public static void main(String[] args) {
        practice1 t = new practice1();
        for(int i=0;i<7;i++){
            System.out.println(t);
            t.change();
        }
    }
}
